package com.jwsoft.manager.core.gateway.controller;

import com.jwsoft.manager.core.integration.EdutStudentEnrollPreIntegration;
import com.jwsoft.manager.common.vo.edutStudentEnrollPre.EdutStudentEnrollPreVO;
import com.jwsoft.manager.common.vo.edutStudentEnrollPre.EdutStudentEnrollPreKeyVO;
import com.jwsoft.manager.common.vo.edutStudentEnrollPre.EdutStudentEnrollPreQueryVO;
import com.github.pagehelper.PageInfo;
import com.bifang.engine.assistant.core.domain.AppResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import com.bifang.engine.protect.core.annotation.Idempotent;
import org.springframework.validation.annotation.Validated;
import com.bifang.assistant.common.constants.Validators;

/**
 * 预采集报名备份表网关
 *
 * @author zhiyuan
 * @since 2023-10-13
 */
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "预采集报名备份表", description = "预采集报名备份表")
public class EdutStudentEnrollPreController {

    @Autowired
    public EdutStudentEnrollPreIntegration edutStudentEnrollPreIntegration;

    @Operation(summary = "预采集报名备份表分页查询",description = "预采集报名备份表分页查询")
    @PostMapping(value = "/edutStudentEnrollPre0001", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EdutStudentEnrollPreVO>> getList(@RequestBody @Validated EdutStudentEnrollPreQueryVO vo) {
        return AppResponse.successData(edutStudentEnrollPreIntegration.getList(vo));
    }

    @Operation(summary = "预采集报名备份表根据主键查询详情",description = "预采集报名备份表根据主键查询详情")
    @PostMapping(value = "/edutStudentEnrollPre0002", produces = "application/json;charset=UTF-8")
    public AppResponse<EdutStudentEnrollPreVO> getById(@RequestBody @Validated EdutStudentEnrollPreKeyVO vo) {
        return AppResponse.successData(edutStudentEnrollPreIntegration.getById(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "预采集报名备份表新增",description = "预采集报名备份表新增")
    @PostMapping(value = "/edutStudentEnrollPre0004", produces = "application/json;charset=UTF-8")
    public AppResponse<EdutStudentEnrollPreVO> add(@RequestBody @Validated(value = {Validators.Add.class}) EdutStudentEnrollPreVO vo) {
        return AppResponse.successData(edutStudentEnrollPreIntegration.add(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "预采集报名备份表修改",description = "预采集报名备份表修改")
    @PostMapping(value = "/edutStudentEnrollPre0005", produces = "application/json;charset=UTF-8")
    public AppResponse<EdutStudentEnrollPreVO> edit(@RequestBody @Validated(value = {Validators.Edit.class}) EdutStudentEnrollPreVO vo) {
        return AppResponse.successData(edutStudentEnrollPreIntegration.edit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "预采集报名备份表删除",description = "预采集报名备份表删除")
    @PostMapping(value = "/edutStudentEnrollPre0006", produces = "application/json;charset=UTF-8")
    public AppResponse del(@RequestBody @Validated EdutStudentEnrollPreKeyVO vo) {
        edutStudentEnrollPreIntegration.del(vo);
        return AppResponse.successMsg("删除成功！");
    }
}
